package com.atguigu.jxc.controller;


import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.DamageList;
import com.atguigu.jxc.service.DamageListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/damageListGoods")
public class DamageListGoodsController {

    /*http://localhost:8080/damageListGoods/save?damageNumber=BS1605766644460（报损单号,前端生成）
    请求参数：
    DamageList damageList, String damageListGoodsStr
    请求方式：POST
    返回值类型：JSON
    返回值：ServiceVO*/
    @Autowired
    private DamageListGoodsService damageListGoodsService;
    @PostMapping("/save")
    public ServiceVO list(DamageList damageList, String damageListGoodsStr){
        damageListGoodsService.saveDamage(damageList,damageListGoodsStr);
        return new ServiceVO(100,"请求成功");


    }

}
